package com.example.demo.pojos;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

public class UserrolePK implements Serializable {
    private int uid;
    private int rid;

    @Column(name = "uid", nullable = false)
    @Id
    public int getUid() {
        return uid;
    }

    public void setUid(int uid) {
        this.uid = uid;
    }

    @Column(name = "rid", nullable = false)
    @Id
    public int getRid() {
        return rid;
    }

    public void setRid(int rid) {
        this.rid = rid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserrolePK that = (UserrolePK) o;
        return uid == that.uid &&
                rid == that.rid;
    }

    @Override
    public int hashCode() {
        return Objects.hash(uid, rid);
    }
}
